FROM 172.25.42.235:5000/devops/jdk-1.8.0_151:latest
RUN rm -f /etc/localtime \
&& ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
 
ENV LANG en_US.UTF-8
 
ADD elasticsearch-8.1.0-linux-x86_64.tar.gz /opt
 
 
RUN mkdir -p /opt/elasticsearch-8.1.0/data \
&& mkdir -p /opt/elasticsearch-8.1.0/logs \
&& useradd elasticsearch \
&& chown -R elasticsearch:elasticsearch /opt \
&& chmod -R 777 /opt \
&& setfacl -R -m u:elasticsearch:rwx /opt \
&& setfacl -R -m u:elasticsearch:rwx /opt \
&& rm -f /opt/elasticsearch-8.1.0/config/elasticsearch.yml
 
COPY elasticsearch.yml /opt/elasticsearch-8.1.0/config/
 
USER elasticsearch
 
EXPOSE 9200 9300
CMD ["/opt/elasticsearch-8.1.0/bin/elasticsearch"]

